Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade CallbackFunction default runtime to Node 20.x #4348

Merged
merged 10 commits into from
Aug 8, 2024
Merged

Conversation

t0yv0
Copy link
Member

@t0yv0 t0yv0 commented Aug 6, 2024

This is a breaking change for users of Node automatically provisioned lambdas, moving them from the Node 16.x to Node 20.x runtime without an ability to opt out.

Prior to this change, Lambda functions provisioned in Node with CallbackFunction and helper methods such as Bucket.onObjectRemoved, Bucket.onObjectCreated or sns.Topic.onEvent used Node 16.x runtime by default. Per lambda-runtimes.html this is now deprecated by AWS. After the change, the new default runtime is Node 20.x.

Fixes #4134

The change is supported by strengthening a test to utilize fetch() API that was made available in 18.x and exercise the callback function at runtime.

@t0yv0 t0yv0 requested a review from corymhall August 6, 2024 22:38
Copy link

github-actions bot commented Aug 6, 2024

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Maintainer note: consult the runbook for dealing with any breaking changes.

Copy link
Contributor

@corymhall corymhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just 1 suggestion

const functionArgs = {
...args,
code: code,
handler: serializedFileNameNoExtension + "." + handlerName,
runtime: args.runtime || Runtime.NodeJS16dX,
runtime: args.runtime || Runtime.NodeJS18dX,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we take the opportunity to just upgrade to 20x?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, #4134 was suggesting 18 as the current LTS but https://endoflife.date/nodejs suggests 20 is the current LTS so that should be reasonable.

Copy link
Contributor

@flostadler flostadler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though it's a breaking change I think not doing it would be a greater issue for our users.
Function creates using node 16 will be blocked on Feb 28, 2025 and updates will be blocked on Mar 31, 2025.

We should really directly upgrade to node 20 though. The node 18 runtime is still using AL2 under the hood (see AWS docs) which will be deprecated in June 2025. There's a high chance they'll deprecate Node 18 as well in the near future.

@flostadler
Copy link
Contributor

We should mark the Node 16.x runtime as deprecated as well: https://github.com/pulumi/pulumi-aws/blob/master/provider/resources.go#L4541

@@ -406,13 +406,11 @@ export class CallbackFunction<E, R> extends LambdaFunction {
// Copy over all option values into the function args. Then overwrite anything we care
Copy link
Contributor

@flostadler flostadler Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't put the comment on that line because it's outside of the PR, but we should also update the docs to reflect the new default:

* The Lambda runtime to use. If not provided, will default to [NodeJS8d10Runtime]

Seems like that docstring is outdated anyways right now :(

@t0yv0 t0yv0 changed the title Upgrade CallbackFunction default runtime to Node 18.x Upgrade CallbackFunction default runtime to Node 20.x Aug 7, 2024
Copy link
Contributor

@flostadler flostadler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@t0yv0 t0yv0 requested a review from flostadler August 7, 2024 21:20
@t0yv0
Copy link
Member Author

t0yv0 commented Aug 7, 2024

PTAL @flostadler addressed the feedback.

Even though it's a breaking change I think not doing it would be a greater issue for our users.

I suspect just a slightly unexpected upgrade. Just calling it out for the release notes, still doing a minor release on this. Some more discussion on this in #4134

@t0yv0 t0yv0 merged commit 2a3dd78 into master Aug 8, 2024
30 checks passed
@t0yv0 t0yv0 deleted the t0yv0/fix-4134 branch August 8, 2024 15:19
lumiere-bot bot referenced this pull request in coolguy1771/home-ops Aug 14, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@pulumi/aws](https://pulumi.io)
([source](https://togithub.com/pulumi/pulumi-aws)) | dependencies |
minor | [`6.48.0` ->
`6.49.0`](https://renovatebot.com/diffs/npm/@pulumi%2faws/6.48.0/6.49.0)
|

---

### Release Notes

<details>
<summary>pulumi/pulumi-aws (@&#8203;pulumi/aws)</summary>

###
[`v6.49.0`](https://togithub.com/pulumi/pulumi-aws/releases/tag/v6.49.0)

[Compare
Source](https://togithub.com/pulumi/pulumi-aws/compare/v6.48.0...v6.49.0)

##### Does the PR have any schema changes?

Looking good! No breaking changes found.

##### New resources:

-   `ebs/snapshotBlockPublicAccess.SnapshotBlockPublicAccess`
-   `lambda/callbackFunction.CallbackFunction`
-   `rds/integration.Integration`

##### New functions:

-   `rds/getClusterParameterGroup.getClusterParameterGroup`
-   `secretsmanager/getSecretVersions.getSecretVersions`

##### What's Changed

- Update GitHub Actions workflows. by
[@&#8203;pulumi-bot](https://togithub.com/pulumi-bot) in
[https://github.com/pulumi/pulumi-aws/pull/4353](https://togithub.com/pulumi/pulumi-aws/pull/4353)
- Upgrade CallbackFunction default runtime to Node 20.x by
[@&#8203;t0yv0](https://togithub.com/t0yv0) in
[https://github.com/pulumi/pulumi-aws/pull/4348](https://togithub.com/pulumi/pulumi-aws/pull/4348)
- Schematize lambda.CallbackFunction overlay and add docs for it by
[@&#8203;flostadler](https://togithub.com/flostadler) in
[https://github.com/pulumi/pulumi-aws/pull/4352](https://togithub.com/pulumi/pulumi-aws/pull/4352)
- Upgrade terraform-provider-aws to v5.62.0 by
[@&#8203;flostadler](https://togithub.com/flostadler) in
[https://github.com/pulumi/pulumi-aws/pull/4359](https://togithub.com/pulumi/pulumi-aws/pull/4359)

**Full Changelog**:
pulumi/pulumi-aws@v6.48.0...v6.49.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNS4yIiwidXBkYXRlZEluVmVyIjoiMzguMjUuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsidHlwZS9taW5vciJdfQ==-->

Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
lumiere-bot bot referenced this pull request in coolguy1771/home-ops Aug 14, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@pulumi/aws](https://pulumi.io)
([source](https://togithub.com/pulumi/pulumi-aws)) | dependencies |
minor | [`6.48.0` ->
`6.49.0`](https://renovatebot.com/diffs/npm/@pulumi%2faws/6.48.0/6.49.0)
|

---

### Release Notes

<details>
<summary>pulumi/pulumi-aws (@&#8203;pulumi/aws)</summary>

###
[`v6.49.0`](https://togithub.com/pulumi/pulumi-aws/releases/tag/v6.49.0)

[Compare
Source](https://togithub.com/pulumi/pulumi-aws/compare/v6.48.0...v6.49.0)

##### Does the PR have any schema changes?

Looking good! No breaking changes found.

##### New resources:

-   `ebs/snapshotBlockPublicAccess.SnapshotBlockPublicAccess`
-   `lambda/callbackFunction.CallbackFunction`
-   `rds/integration.Integration`

##### New functions:

-   `rds/getClusterParameterGroup.getClusterParameterGroup`
-   `secretsmanager/getSecretVersions.getSecretVersions`

##### What's Changed

- Update GitHub Actions workflows. by
[@&#8203;pulumi-bot](https://togithub.com/pulumi-bot) in
[https://github.com/pulumi/pulumi-aws/pull/4353](https://togithub.com/pulumi/pulumi-aws/pull/4353)
- Upgrade CallbackFunction default runtime to Node 20.x by
[@&#8203;t0yv0](https://togithub.com/t0yv0) in
[https://github.com/pulumi/pulumi-aws/pull/4348](https://togithub.com/pulumi/pulumi-aws/pull/4348)
- Schematize lambda.CallbackFunction overlay and add docs for it by
[@&#8203;flostadler](https://togithub.com/flostadler) in
[https://github.com/pulumi/pulumi-aws/pull/4352](https://togithub.com/pulumi/pulumi-aws/pull/4352)
- Upgrade terraform-provider-aws to v5.62.0 by
[@&#8203;flostadler](https://togithub.com/flostadler) in
[https://github.com/pulumi/pulumi-aws/pull/4359](https://togithub.com/pulumi/pulumi-aws/pull/4359)

**Full Changelog**:
pulumi/pulumi-aws@v6.48.0...v6.49.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNS4yIiwidXBkYXRlZEluVmVyIjoiMzguMjUuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsidHlwZS9taW5vciJdfQ==-->

Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
@mjeffryes mjeffryes added this to the 0.108 milestone Aug 16, 2024
@mikhailshilkov
Copy link
Member

This PR has been shipped in release v6.49.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default Node runtime for lambdaMixins is out of LTS (and marked as EOL)
5 participants